package com.example.common.enums;

public enum BusinessTypeEnum {

    ORDER("order", "SCD");

    private String code;

    private String value;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    BusinessTypeEnum(String code, String value){
        this.code = code;
        this.value = value;
    }

    public static BusinessTypeEnum getValue(String code){
        BusinessTypeEnum businessTypeEnum = null;
        for (BusinessTypeEnum value: values()){
            if (value.getCode().equals(code)){
                businessTypeEnum = value;
                continue;
            }
        }

        return businessTypeEnum;
    }
}
